-- 象棋试水之作
-- require了这个模块的话，应该返回engine？需要讨论

local engine_klass = require "packages.chess-games.xiangqi.core.engine"

local Rook = require "packages.chess-games.xiangqi.core.pieces.rook"
local Knight = require "packages.chess-games.xiangqi.core.pieces.knight"
local Bishop = require "packages.chess-games.xiangqi.core.pieces.bishop"
local Advisor= require "packages.chess-games.xiangqi.core.pieces.advisor"
local King   = require "packages.chess-games.xiangqi.core.pieces.king"
local Cannon = require "packages.chess-games.xiangqi.core.pieces.cannon"
local Pawn   = require "packages.chess-games.xiangqi.core.pieces.pawn"

local Xq = engine_klass:new()

-- =====================
-- 红方
-- =====================
Xq:addPiece(Rook:new(Xq.rR1))
Xq:addPiece(Knight:new(Xq.rN1))
Xq:addPiece(Bishop:new(Xq.rB1))
Xq:addPiece(Advisor:new(Xq.rA1))
Xq:addPiece(King:new(Xq.rK))
Xq:addPiece(Advisor:new(Xq.rA2))
Xq:addPiece(Bishop:new(Xq.rB2))
Xq:addPiece(Knight:new(Xq.rN2))
Xq:addPiece(Rook:new(Xq.rR2))

Xq:addPiece(Cannon:new(Xq.rC1))
Xq:addPiece(Cannon:new(Xq.rC2))

Xq:addPiece(Pawn:new(Xq.rP1))
Xq:addPiece(Pawn:new(Xq.rP2))
Xq:addPiece(Pawn:new(Xq.rP3))
Xq:addPiece(Pawn:new(Xq.rP4))
Xq:addPiece(Pawn:new(Xq.rP5))

-- =====================
-- 黑方
-- =====================
Xq:addPiece(Rook:new(Xq.bR1))
Xq:addPiece(Knight:new(Xq.bN1))
Xq:addPiece(Bishop:new(Xq.bB1))
Xq:addPiece(Advisor:new(Xq.bA1))
Xq:addPiece(King:new(Xq.bK))
Xq:addPiece(Advisor:new(Xq.bA2))
Xq:addPiece(Bishop:new(Xq.bB2))
Xq:addPiece(Knight:new(Xq.bN2))
Xq:addPiece(Rook:new(Xq.bR2))

Xq:addPiece(Cannon:new(Xq.bC1))
Xq:addPiece(Cannon:new(Xq.bC2))

Xq:addPiece(Pawn:new(Xq.bP1))
Xq:addPiece(Pawn:new(Xq.bP2))
Xq:addPiece(Pawn:new(Xq.bP3))
Xq:addPiece(Pawn:new(Xq.bP4))
Xq:addPiece(Pawn:new(Xq.bP5))

Fk:loadTranslationTable {
  ["#XiangqiStart"] = "== %arg(<font color='red'><b>红</b></font>) 对 %arg2(<b>黑</b>) ==",
  ["#XiangqiMove"] = "%arg. %arg2 %arg3",
  ["#XiangqiMoveHalf"] = "%arg. %arg2",
}

return Xq
